Awt Util
Miscellaneous functions to make AWT/Swing programming easier.
Properties
Functions
Returns an instance of java.awt.Color for the given string, which should consist of a 6 digit hexadecimal string with a prefix of either '0x' or '#'. Returns null if the string specifies an invalid color.
Draw diagonal hashing lines over the given area.
Enable antialiasing on the given graphics object if it was an instance of Graphics2D. Returns the cast Graphics2D as a convenience.
Returns the nearest Frame or JDialog that is an ancestor to the given component. If no JDialog or Frame is found then return the top-most component ancestor.
Return the hex string for the given colour. This does not include any 0x or # prefix and is only the 6 digit hexadecimal string.
Returns true if the given event should cause a context menu to be displayed for the item that was clicked. In general, if it was a secondary or right mouse button click, a control-click on mac, or possibly (but not currently) an alt-click on windows.
Returns true if the given event should select the target item, as well as all items between it and the previously selected item. In other words, was it a shift-click?
Returns true if the given event should add a single item to the selection (ie alt-click on windows/linux or command-click on mac)
Set up the given window at the given size and location or centered on the given parent, if provided. This will ensure that the window is centered on the parent, the display with the given coordinates, or the default/main display if none of those apply. It will also ensure that the window is not shown off-screen and not too large to fit on the selected display.